#!/bin/bash
# init database
# $1 账号 root
# $2 密码 123456
# $3 数据库名 建议使用默认数据库名：dw
echo 账号：$1
echo 密码：$2
echo 数据库名：$3
echo 数据库初始化中，请耐心等待………………
mysql -u $1 -p$2 <<EOF

drop database if exists $3;
CREATE DATABASE $3 CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
USE $3;
source /var/lib/mysql/dw.sql;

EOF
echo 'InitDatabase Successed!'!
echo -e '数据库初始化完成!\n'

 echo "            .,,       .,:;;iiiiiiiii;;:,,.     .,,"
 echo "          rGB##HS,.;iirrrrriiiiiiiiiirrrrri;,s&##MAS,"
 echo "         r5s;:r3AH5iiiii;;;;;;;;;;;;;;;;iiirXHGSsiih1,"
 echo "            .;i;;s91;;;;;;::::::::::::;;;;iS5;;;ii:"
 echo "          :rsriii;;r::::::::::::::::::::::;;,;;iiirsi,"
 echo "       .,iri;;::::;;;;;;::,,,,,,,,,,,,,..,,;;;;;;;;iiri,,."
 echo "    ,9BM&,            .,:;;:,,,,,,,,,,,hXA8:            ..,,,."
 echo "   ,;&@@#r:;;;;;::::,,.   ,r,,,,,,,,,,iA@@@s,,:::;;;::,,.   .;."
 echo "    :ih1iii;;;;;::::;;;;;;;:,,,,,,,,,,;i55r;;;;;;;;;iiirrrr,.."
 echo "   .ir;;iiiiiiiiii;;;;::::::,,,,,,,:::::,,:;;;iiiiiiiiiiiiri"
 echo "   iriiiiiiiiiiiiiiii;;;::::::::::::::::;;;iiiiiiiiiiiiiiiir;"
 echo "  ,riii;;;;;;;;;;;;;:::::::::::::::::::::::;;;;;;;;;;;;;;iiir."
 echo "  iri;;;::::,,,,,,,,,,:::::::::::::::::::::::::,::,,::::;;iir:"
 echo " .rii;;::::,,,,,,,,,,,,:::::::::::::::::,,,,,,,,,,,,,::::;;iri"
 echo " ,rii;;;::,,,,,,,,,,,,,:::::::::::,:::::,,,,,,,,,,,,,:::;;;iir."
 echo " ,rii;;i::,,,,,,,,,,,,,:::::::::::::::::,,,,,,,,,,,,,,::i;;iir."
 echo " ,rii;;r::,,,,,,,,,,,,,:,:::::,:,:::::::,,,,,,,,,,,,,::;r;;iir."
 echo " .rii;;rr,:,,,,,,,,,,,,,,:::::::::::::::,,,,,,,,,,,,,:,si;;iri"
 echo "  ;rii;:1i,,,,,,,,,,,,,,,,,,:::::::::,,,,,,,,,,,,,,,:,ss:;iir:"
 echo "  .rii;;;5r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sh:;;iri"
 echo "   ;rii;:;51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.:hh:;;iir,"
 echo "    irii;::hSr,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,sSs:;;iir:"
 echo "     irii;;:iSSs:.,,,,,,,,,,,,,,,,,,,,,,,,,,,..:135;:;;iir:"
 echo "      ;rii;;:,r535r:...,,,,,,,,,,,,,,,,,,..,;sS35i,;;iirr:"
 echo "       :rrii;;:,;1S3Shs;:,............,:is533Ss:,;;;iiri,"
 echo "        .;rrii;;;:,;rhS393S55hh11hh5S3393Shr:,:;;;iirr:"
 echo "          .;rriii;;;::,:;is1h555555h1si;:,::;;;iirri:."
 echo "            .:irrrii;;;;;:::,,,,,,,,:::;;;;iiirrr;,"
 echo "               .:irrrriiiiii;;;;;;;;iiiiiirrrr;,."
 echo "                  .,:;iirrrrrrrrrrrrrrrrri;:."
 echo "                        ..,:::;;;;:::,,."

exit;

